package edzest.basic;

public class Ch04{
	public static void main(String[] agrs){
		Ch04_S1 s1 = new Ch04_S1(
				"Dancing Queen", "ABBA", "DQ", "Swed", "1970", "1번");
		System.out.print(s1.title + "\t");
		System.out.print(s1.artist + "\t");
		System.out.print(s1.album + "\t");
		System.out.print(s1.composer + "\t");
		System.out.print(s1.year + "\t");
		System.out.println(s1.track + "\t");
		
		Ch04_S2 s2 = new Ch04_S2();
		Ch04_S2 s22 = new Ch04_S2(3, 6, 7, 10);
		s2.set(3, 6, 7, 10);
		s2.square();
		s2.show();
		s22.show();
		if(s2.equals(s22)){
			System.out.println("두 사각형은 같습니다.");
		}
	}
}

class Ch04_Q3{
	String manufacturer, name, country, region, kind;
	int year, grade;
	
	public Ch04_Q3(String manufacturer, String name, String country
			, String region, String kind, int year, int grade){
		this.manufacturer = manufacturer;
		this.name = name;
		this.country = country;
		this.region = region;
		this.kind = kind;
		this.year = year;
		this.grade = grade;
	}
	
	public Ch04_Q3(String manufacturer, String name){
		this.manufacturer = manufacturer;
		this.name = name;
	}
}

class Ch04_Q9{
	public int doAdd(int i, int j){
		return i + j;
	}
	public float doAdd1(int i, int j){
		return (float)(i+j);
	}
}

class Ch04_S1{
	String title, artist, album, composer, year, track;
	public Ch04_S1(String title, String artist, String album,
			String composer, String year, String track){
		this.title = title;
		this.artist = artist;
		this.album = album;
		this.composer = composer;
		this.year = year;
		this.track = track;
	}
	
}

class Ch04_S2{
	int x1, y1, x2, y2;
	public Ch04_S2() {
	}
	public Ch04_S2(int x1, int y1, int x2, int y2){
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
	}
	
	void set(int x1, int y1, int x2, int y2){
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
	}
	
	int square(){
		int square = (x1-x2)*(y1-y2);
		return square;
	}
	
	void show(){
		System.out.println(x1+" "+y1+" "+x2+" "+y2);
		System.out.println(square());
	}
	
}















